package com.springboot.dubbo.consumer.utils;

/**
 * @Author: guodong
 * @Date: 2020/10/16 14:17
 * @Version: 1.0
 * @Description:
 */
public class AbstractMyThreadContext {

    public static final String TRACE_ID = "TRACE_ID";
    public static final String MDC_TRACE_ID = "MDC_TRACE_ID";

    private static ThreadLocal<String> threadLocal = new ThreadLocal<String>();

    public static void setTraceId(String traceId){
        threadLocal.set(traceId);
    }

    public static String getTraceId(){
        return threadLocal.get();
    }

    public static void removeTraceId(){
        threadLocal.remove();
    }


}
